package client

import (
	"advertising/internal/app/grpc/protoc/devicec"
	"context"

	"192.168.1.75/go-pkg/errorx"
	"192.168.1.75/go-pkg/logx"
	"192.168.1.75/go-pkg/svsdis"
)

// GetDeviceAdminClient 获取grpc客户端
func GetDeviceAdminClient() (devicec.AdminServiceClient, error) {
	conn, err := svsdis.GRPCConn("device-admin")
	if err != nil {
		logx.Error(context.Background(), "GetSystemAdminClient err")
		return nil, errorx.New("获取服务失败", -1)
	}
	cli := devicec.NewAdminServiceClient(conn)
	return cli, nil
}
